1. Technical Field
The present invention relates to data storage and, in particular, to redundant arrays of independent disks. Still more particularly, the present invention provides a method, apparatus, and program for data mirroring with striped hotspare.
2. Description of the Related Art
Redundant array of independent disks (RAID) is a disk subsystem that is used to increase performance and provide fault tolerance. RAID is a set of two or more ordinary storage devices and a specialized disk controller that contains the RAID functionality. RAID can also be implemented via software only. RAID can improve performance by disk striping, which interleaves bytes or groups of bytes across multiple drives, so more than one disk is reading and writing simultaneously. Striping is referred to as RAID 0.
Fault tolerance is achieved by mirroring or parity. Mirroring is 100% duplication of the data on two storage devices. Mirroring is referred to as RAID 1. With reference to FIG. 1A, an example RAID 1 configuration is shown. RAID controller 102 receives data and manages the storage of the data onto storage devices, for example disk drives 112, 114. FIG. 1B is a table that shows the storage of data blocks, or stripes, on the drives. The RAID controller may store the data, for example, on drive 0 and mirror or copy each stripe onto a drive 1, as shown in FIG. 1B. If one of the drives fails, the other drive can be used to maintain data integrity.
A failed drive can be hot swapped with a new one, and the RAID controller automatically rebuilds the lost data. A hotspare is a spare disk drive in a RAID configuration that is put into action when another drive fails. Using the RAID algorithms, the missing data from the faulty drive is reconstructed and written to the hot spare. When the bad drive is replaced, it then may become the hotspare. With reference now to FIG. 2A, an example RAID 1 configuration with hotspare is shown. RAID controller 202 receives data and manages the storage of the data onto storage devices, for example disk drives 212, 214. Hotspare drive 216 is provided as a dedicated drive that may be put into action if drive 0 or drive 1 fails. FIG. 2B is a table that shows the storage of the data on the drives. The RAID controller may store the data, for example, on drive 0 and mirror or copy each stripe onto drive 1, as shown in FIG. 2B. If one of the drives fails, the remaining drive can be used to maintain data integrity and the data from the remaining drive can be reconstructed onto the hotspare drive to retain fault tolerance.
However, since the hotspare drive is unused unless a drive fails, the use of a dedicated hotspare drive results in a waste of bandwidth. Access requests, particularly read requests, must be balanced between two drives, while the dedicated hotspare drive sits idle. Furthermore, if a drive fails, all of the data stored on the drives must be reconstructed onto the hotspare drive. As the amount of data increases, the time required to activate the hotspare drive increases.
Therefore, it would be advantageous to provide an improved mechanism for providing data mirroring with hotspare.